const {
	Service
} = require('uni-cloud-router')

module.exports = class NoticeService extends Service {
	async getNotices({
		city,
		issue = true,
		eredar = false
	}) {
		try {
			var res = await this.db.collection('t3ds-notice').where({
					'region.city.value': city,
					issue,
					eredar
				})
				.get()
			if (res.data.length) {
				return res.data
			}
			return []
		} catch (e) {
			throw e
		}
	}
}